package com.itheima.api.client;

import com.itheima.api.client.dto.WebUser;
import com.itheima.common.domain.PageResDto;
import com.itheima.common.domain.R;
import com.itheima.common.vo.CommentPageDTO;
import com.itheima.common.vo.CommentVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "blog-web")
public interface UserClient {

    @GetMapping("web/user/name")
    List<Integer> queryWebUsersByName(String name);

    @GetMapping("web/user/ids")
    List<WebUser> queryWebUsersByIds(List<Integer> userIds);

    @GetMapping("web/user/id")
    WebUser queryWebUserById(Long userId);

    @PostMapping("web/comment/page")
    PageResDto<CommentVO> page(@RequestBody CommentPageDTO dto);

    @DeleteMapping("web/comment")
    R<String> delete(List<Integer> ids);
}
